'''
5.3.5 使用Pandas实现Excel数据拆分
'''

import pandas as pd

peoples = pd.read_excel('pandas5.xlsx', index_col='ID')

# 将Full Name拆分成姓氏与姓名
df = peoples['Full Name'].str.split(expand=True)
# df2  = peoples['Full Name'].str.split(expand=False)
peoples['姓氏'] = df[0]
peoples['姓名'] = df[1]
print(peoples)